home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CD School House 10
/
CD School House - Education and Games (10.0) - Wayzata Technology (1995).iso
/
mac
/
DOS
/
MATH
/
ODE25
/
PENDULUM.ODE
< prev
next >
Wrap
Text File
|
1994-03-03
|
617b
|
22 lines
# PENDULUM.ODE
# A real pendulum - a non-linear oscillator.
# If amplitude is small (controlled by initial omega), output will be almost
# sinusoidal, but not for large amplitudes.
# If omega(0) is large enough (how large?), pendulum will go right round
# instead of oscillating.
# Notice how frequency depends on amplitude.
# Plot theta against time.
# Solve with 4th order Runge-Kutta, fixed step size, to t=50, 200 steps
$m -4
$t 50
$n 200
# theta is angle with respect to vertical (in radians)
theta = 0
# omega is angular velocity
omega = 2, 1, 0.5
theta' = omega
omega' = -sin(theta)